<?php
get_header();
?>
	<section class="main">
		<nav class="main-nav">
			<ul>						
				<?php 
					$taxonomies = 'building-type';
					$args  = array('hide_empty'=>false);
					$terms = get_terms( $taxonomies, $args ) ;
					foreach($terms as $term){							
						if( $term->parent == 0 && get_tax_meta($term->term_id,'building_tax_show_home') == 1){
							?>
						<li <?php echo checkActiveMenuHome($term->term_id)?>><a href="<?php echo get_term_link($term,$taxonomies);?>"><?php echo $term->name;?></a></li>
						<li class="line-nav"></li>
					<?php
						}
					}
				?>
				<?php $pageid = 58 ;if(ICL_LANGUAGE_CODE == 'vi') $pageid = 76 ;?>
			   <li><a href="<?php echo get_page_link($pageid)?>">
					<?php echo get_page($pageid)->post_title; ?>
				</a></li>
			</ul>
		</nav>
    	<?php get_sidebar(); ?>        
        <!-- main content -->
        <section class="main-content">
			<section class="discrumble">
				<?php if(function_exists('bcn_display')){ bcn_display();}?>
			</section>
			<section class="col-main">
				<div class="detail">
					<?php $curauth = get_userdata(intval($author));?>
					<h1 class="detail-title"><?php _e('Contact with ','building')?><?php echo get_the_author();?></h1>
					<div class="detail-send">						
						<div class="send-right">	
							<h3 class="des-title"><?php _e('Agent','building')?></h3>
							<div class="form-send" style="border-right:0 none;">
								<p><strong><?php echo $curauth->user_nicename?></strong></p>
								<p class="frm-img">
									<?php if($curauth->image == ''):
										echo get_avatar( get_the_author_meta( $curauth->ID ), 190 );
									?>	
									<?php else: ?>
										<img alt="<?php echo $curauth->user_nicename?>" src="<?php echo $curauth->image?>" style="max-width: 100%;">
									<?php endif;?>									
								</p>
								<p>
									<strong><?php _e('Company:','building')?></strong>
									<a href="<?php echo $curauth->user_url;?>"><?php echo $curauth->company;?></a>
								</p>
								<p>
									<strong><?php _e('Mobile:','building')?></strong>
									<?php echo $curauth->mobile;?>
								</p>
							</div>
						</div>
						<div class="send-left">
							<h3 class="des-title"><?php _e('Send Enquiry','building')?></h3>
							<div class="form-send">
								<?php echo do_shortcode('[contact-form-7 id="69" title="Contact Agent"]');?>
								<?php
									$emailTo = $curauth->user_email;
								?>
								<script type="text/javascript">
									jQuery(document).ready(function($){
										$('.wpcf7-form #emailTo').attr('value','<?php echo $emailTo;?>')
									})
								</script>
							</div>
						</div>
					</div>
				</div>
			</section>
        </section>
        <!-- end main content -->
        <div class="clear"></div>
    </section>
    <!-- content -->
<?php get_footer(); ?>